import request from '@/utils/request'

// 违规分页查询
export function getViolationPage(params, isAdmin = false) {
  return request({
    url: isAdmin ? '/admin/violation/page' : '/user/violation/page',
    method: 'get',
    params
  })
}

// 删除违法记录
export function deleteViolation(id) {
  return request({
    url: `/admin/violation?ids=${id}`,
    method: 'delete'
  })
}

// 查询违规详情
export function getViolationDetail(id) {
  return request({
    url: `/admin/violation/${id}`,
    method: 'get'
  })
}

// 新增违法记录
export function addViolation(data) {
  return request({
    url: '/admin/violation',
    method: 'post',
    data
  })
}

// 上传违法记录
export function uploadIllegal(data) {
  return request({
    url: '/admin/violation/uploadIllegal',
    method: 'post',
    data
  })
}

// 上传视频分析结果
export function uploadVideoAnalysisResult(data) {
  return request({
    url: '/admin/violation/uploadVideoAnalysis',
    method: 'post',
    data
  })
}
